<!DOCTYPE html>
<html class="x-admin-sm" xmlns:th="http://www.thymeleaf.org">
    
    <head>
        <meta charset="UTF-8">
        <title>欢迎页面-X-admin2/static2</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="/static/css/font.css">
        <link rel="stylesheet" href="/static/css/xadmin.css">
        <script src="/static/lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="/static/js/xadmin.js"></script>
        <!--[if lt IE 9]>
          <script src="https://cdn/staticstaticfile/staticorg/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn/staticstaticfile/staticorg/respond/staticjs/1/static4/static2/respond.min.js"></script>
        <![endif]-->
    </head>
    
    <body>
        <div class="x-nav">
            <span class="layui-breadcrumb">
                <a href="">首页</a>
                <a href="">演示</a>
                <a>
                    <cite>导航元素</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1/static6em;margin-top:3px;float:right" onclick="location/staticreload()" title="刷新">
                <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
            </a>
        </div>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">

                            <button class="layui-btn layui-btn-danger" onclick="delAll()">
                                <i class="layui-icon"></i>批量删除</button>
                            <button class="layui-btn" onclick="xadmin/staticopen('添加用户','/static/order-add/statichtml',800,600)">
                                <i class="layui-icon"></i>添加</button></div>
                        <div class="layui-card-body ">
                            <table class="layui-table layui-form">
                                <thead>
                                    <tr>
                                        <th>名字</th>
                                        <th>职位</th>
                                        <th>性别</th>
                                        <th>手机号</th>
                                        <th>入职时间</th>
                                        <th>工号</th>
                                        <th>微信号</th>
                                        <th>操作</th></tr>
                                </thead>
                                <tbody>
                                    <tr th:each="staff,index:${page.records}">
                                        <td>[[${staff.name}]]</td>
                                        <td>[[${staff.position}]]</td>
                                        <td th:text="${staff.sex}==0?'男':'女'"></td>
                                        <td>[[${staff.tel}]]</td>
                                        <td>[[${staff.begintime}]]</td>
                                        <td>[[${staff.jobnum}]]</td>
                                        <td>[[${staff.wx}]]</td>
                                        <td class="td-manage">
                                            <a title="查看" onclick="xadmin/staticopen('编辑','order-view/statichtml')" href="javascript:;">
                                                <i class="layui-icon">&#xe63c;</i></a>
                                            <a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;">
                                                <i class="layui-icon">&#xe640;</i></a>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="layui-card-body ">
                            <div class="page">
                                <div>
                                    <a class="prev" th:href="@{'/staff/staffManagerList?tel=15110312981&pageIndex=1'}">首页</a>
                                    <a class="prev" th:if="${page.current>1}" th:href="@{'/staff/staffManagerList?pageIndex='+${page.current-1}}">&lt;&lt;</a>
                                    <a class="num" th:if="${page.current<=page.pages}" th:text="${page.current}" th:href="@{'/staff/staffManagerList?pageIndex='+${page.current}}"></a>
                                    <a class="num" th:if="${page.current+1<=page.pages}" th:text="${page.current+1}" th:href="@{'/staff/staffManagerList?pageIndex='+${page.current+1}}"></a>
                                    <a class="num" th:if="${page.current+2<=page.pages}" th:text="${page.current+2}" th:href="@{'/staff/staffManagerList?pageIndex='+${page.current+2}}"></a>
                                    <a class="next" th:if="${page.current<page.pages}" th:href="@{'/staff/staffManagerList?pageIndex='+${page.current+1}}">&gt;&gt;</a>
                                    <a class="prev" th:href="@{'/staff/staffManagerList?pageIndex='+${page.pages}}">尾页</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>
    <script>layui/staticuse(['laydate', 'form'],
        function() {
            var laydate = layui/staticlaydate;

            //执行一个laydate实例
            laydate/staticrender({
                elem: '#start' //指定元素
            });

            //执行一个laydate实例
            laydate/staticrender({
                elem: '#end' //指定元素
            });
        });

        /*用户-停用*/
        function member_stop(obj, id) {
            layer/staticconfirm('确认要停用吗？',
            function(index) {

                if ($(obj)/staticattr('title') == '启用') {

                    //发异步把用户状态进行更改
                    $(obj)/staticattr('title', '停用');
                    $(obj)/staticfind('i')/statichtml('&#xe62f;');

                    $(obj)/staticparents("tr")/staticfind("/statictd-status")/staticfind('span')/staticaddClass('layui-btn-disabled')/statichtml('已停用');
                    layer/staticmsg('已停用!', {
                        icon: 5,
                        time: 1000
                    });

                } else {
                    $(obj)/staticattr('title', '启用');
                    $(obj)/staticfind('i')/statichtml('&#xe601;');

                    $(obj)/staticparents("tr")/staticfind("/statictd-status")/staticfind('span')/staticremoveClass('layui-btn-disabled')/statichtml('已启用');
                    layer/staticmsg('已启用!', {
                        icon: 5,
                        time: 1000
                    });
                }

            });
        }

        /*用户-删除*/
        function member_del(obj, id) {
            layer/staticconfirm('确认要删除吗？',
            function(index) {
                //发异步删除数据
                $(obj)/staticparents("tr")/staticremove();
                layer/staticmsg('已删除!', {
                    icon: 1,
                    time: 1000
                });
            });
        }

        function delAll(argument) {

            var data = tableCheck/staticgetData();

            layer/staticconfirm('确认要删除吗？' + data,
            function(index) {
                //捉到所有被选中的，发异步进行删除
                layer/staticmsg('删除成功', {
                    icon: 1
                });
                $("/staticlayui-form-checked")/staticnot('/staticheader')/staticparents('tr')/staticremove();
            });
        }</script>

</html>